<?php $this->load->view('common/header'); ?>
<?php $this->load->view('common/menu'); ?>

<div class="swiper-container banner_main">
    <div class="swiper-wrapper">
        <?php if (!$this->agent->is_mobile()) { ?>
            <?php if ($banner['pc']) : ?>
                <?php foreach ($banner['pc'] as $key => $val) : ?>
                    <div class="swiper-slide"><img src="<?php echo $val['pic_url']; ?>"></div>
                <?php endforeach; ?>
            <?php endif; ?>

        <?php } else { ?>

            <?php if ($banner['mobile']) : ?>
                <?php foreach ($banner['mobile'] as $key => $val) : ?>
                    <div class="swiper-slide"><img src="<?php echo $val['pic_url']; ?>"></div>
                <?php endforeach; ?>
            <?php endif; ?>
        <?php } ?>
    </div>
    <div class="swiper-button-prev"></div>
    <div class="swiper-button-next"></div>
</div>
<div class="hot_product">
    <div class="title">
        <em>最畅销</em>
        <p>Best seller</p>
    </div>
    <div class="box">
        <div class="list swiper-container1">
            <div class="swiper-button-prev"></div>
            <div class="swiper-button-next"></div>
            <ul class="swiper-wrapper">
                <?php if ($hot) : ?>
                    <?php foreach ($hot as $key => $val) : ?>
                        <li class="swiper-slide">
                            <a href="#">
                                <img src="<?php echo $val['img']; ?>">
                                <span>
                                <p><?php echo $val['title']; ?></p>
                                <em><?php echo $val['keyword']; ?></em>
                            </span>
                            </a>
                        </li>
                    <?php endforeach; ?>
                <?php endif; ?>
            </ul>
        </div>
    </div>
</div>
<div class="product_main">
    <div class="title">
        <a href="#">娇薇安斯品牌故事&gt;&gt;</a>
        <em>皮肤护理</em>
        <p>Skin care</p>
    </div>
    <div class="list">
        <!--8个-->
        <ul>
            <?php if ($product) : ?>
                <?php foreach ($product as $key => $val) : ?>
                    <li>
                        <a href="#">
                            <img src="<?php echo $val['img']; ?>">
                            <span>
                                <p><?php echo $val['title']; ?></p>
                                <em><?php echo $val['keyword']; ?></em>
                            </span>
                        </a>
                    </li>
                <?php endforeach; ?>
            <?php endif; ?>
        </ul>
    </div>
</div>
<div class="news_box">
    <div class="title">
        <em>新闻</em>
        <p>News</p>
    </div>
    <div class="list">
        <ul>
            <!--6个-->
            <?php if ($news) : ?>
            <?php foreach ($news as $key => $val) : ?>
            <li>
                <em><?php echo $val['create_time']; ?></em>
                <a href="<?php echo "/news_show/" . $val['id'] . ".html"; ?>"
                   target="_blank"><?php echo $val['title']; ?></a>
                <span><?php echo $val['describe'] ?? ""; ?></span>
            </li>
                <?php endforeach; ?>
            <?php endif; ?>
        </ul>
    </div>
</div>
<script>
    var swiper = new Swiper('.swiper-container', {
        pagination: '.swiper-pagination',
        paginationClickable: false,
        nextButton: '.swiper-button-next',
        prevButton: '.swiper-button-prev',
        parallax: true,
        loop: true,
        speed: 600,
    });

    var swiper1 = new Swiper(".swiper-container1", {
        slidesPerView: 'auto',
        centeredSlides: true,
        loop: true,
        loopedSlides: 5,
        autoplay: 2000,
        pagination: '.swiper-pagination1',
        paginationClickable: false,
        nextButton: '.swiper-button-next',
        prevButton: '.swiper-button-prev',
        parallax: true,
        speed: 600,
    })

</script>
<?php $this->load->view('common/footer'); ?>
